# {{ ansible_managed }}

<VirtualHost *:80>
  ServerName {{ nominatim_config.web_hostname }}
  ServerAlias {{ ansible_fqdn }}
  
  <IfModule mod_remoteip.c> 
    RemoteIPHeader X-Forwarded-For
{% for proxy in apache2_trusted_proxies %}
    RemoteIPInternalProxy {{ proxy }}
{% endfor %}
  </IfModule>
  
  DocumentRoot {{ nominatim_base_dir }}/Nominatim-{{ nominatim_version }}/build/website
  <Directory "{{ nominatim_base_dir }}/Nominatim-{{ nominatim_version }}/build/website">
    Options FollowSymLinks MultiViews
    AddType text/html   .php     
    DirectoryIndex search.php
    Require all granted
  </Directory>

  LogFormat "%a %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined_realip

  CustomLog /var/log/apache2/{{ nominatim_config.web_hostname }}.log combined_realip
  ErrorLog  /var/log/apache2/{{ nominatim_config.web_hostname }}-err.log

</VirtualHost>

